package com.ujiuye.context;

/**
 * @author shiminghui
 * @date 2024/8/20 8:27
 * @description: TODO
 */
public class BaseContext {

    //线程局部变量,可以存储数据,数据只能在本线程访问
    public static ThreadLocal<String> threadLocal = new ThreadLocal<>();

    public static String getCurrentId() {
        return threadLocal.get();
    }

    public static void setCurrentId(String id) {
        threadLocal.set(id);
    }

    public static void removeCurrentId() {
        threadLocal.remove();
    }
}
